package com.kaifamiao.datatypes;

// 测试整数类型
public class Lion {
    public static void main(String[] args) {

        // byte 占 1 个字节， 8个二进制位(bit)
        byte first = 127;
        System.out.println( first );
        System.out.println( "byte max value: " + Byte.MAX_VALUE );
        System.out.println( "byte min value: " + Byte.MIN_VALUE );

        // short 占 2 个字节， 16个二进制位(bit)
        short second = 9527;
        System.out.println( second );
        System.out.println( "short max value: " + Short.MAX_VALUE );
        System.out.println( "short min value: " + Short.MIN_VALUE );

        // int 占 4 个字节， 32个二进制位(bit)
        int third = 9527;
        System.out.println( third );
        System.out.println( "int max value: " + Integer.MAX_VALUE );
        System.out.println( "int min value: " + Integer.MIN_VALUE );

        // long 占 8 个字节， 64个二进制位(bit)
        long fourth = 123456789L;
        System.out.println( fourth );
        System.out.println( "long max value: " + Long.MAX_VALUE );
        System.out.println( "long min value: " + Long.MIN_VALUE );

    }
}
